﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Drawing;
using System.ComponentModel.Design;

namespace NTweet.Krypton {
	[ClassInterface(ClassInterfaceType.AutoDispatch)]
	[Designer("System.Windows.Forms.Design.ControlDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
	[ComVisible(true)]
	[DesignerCategory("UserControl")]
	[Designer("System.Windows.Forms.Design.UserControlDocumentDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(IRootDesigner))]
	[DefaultEvent("Load")]
	public class ViewListBase : UserControl {
		public ViewListBase(int order) {
			this.Order = order;
			this.BackColor = Color.Transparent;
		}

		[Bindable(true)]
		[EditorBrowsable(EditorBrowsableState.Always)]
		[Browsable(true)]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
		public override string Text {
			get { return base.Text; }
			set { base.Text = value; }
		}

		[EditorBrowsable(EditorBrowsableState.Always)]
		[Browsable(true)]
		public new event EventHandler TextChanged {
			add { base.TextChanged += value; }
			remove { base.TextChanged -= value; }
		}

		public Image Image {
			get { return m_Image; }
			set {
				if (!Object.Equals(m_Image, value)) {
					m_Image = value;
					OnImageChanged(EventArgs.Empty);
				}
			}
		}
		private Image m_Image;

		public int Order { get; set; }

		public event EventHandler ImageChanged;
		protected virtual void OnImageChanged(EventArgs e) {
			if (ImageChanged != null) ImageChanged(this, e);
		}
	}
}
